
package de.dtools.n2g.core;

/**
 *	@project:	note2go
 *	@author:	D.Toepel
 *	@version:	2009-08-04
 *	@note:		---
 *	
 *	Copyright (C) 2009  D.Toepel <de.dtools> {at} <gmail> {dot} <com>
 *	
 *	This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *	
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *	
 *	You should have received a copy of the GNU General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *	
 */

public class OptionsSet {
	
	// Common Preferences
	private User localUser;
	private User hostUser;
	private String author;
	private Boolean isRoot;
	private Boolean isPortable;
	
	// Note Preferences
	private Boolean nsetPublic;
	private Boolean nsetAutosync;
	private Integer nsetSynctime;
	private Boolean nsetLocal2host;
	private Boolean nsetHost2local;
	
	// Server / Online Preferences
	private String serverName;
	private Integer serverPort;
	private String serverNick;
	private String serverPword;
	private Boolean serverAutoConnect;
	
	// User / Group Lists
	private String[][] groupList;
	private String[][][] userGroupList;

	
	
    // ***************************************
	// *** GETTERS AND SETTERS ***************
	// ***************************************
    
	public User getLocalUser() {
		return localUser;
	}

	public void setLocalUser(User user) {
		this.localUser = user;
	}

	public User getHostUser() {
		return hostUser;
	}

	public void setHostUser(User user) {
		this.hostUser = user;
	}

	public void setId_online(User user) {
		this.hostUser = user;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Boolean getIsRoot() {
		return isRoot;
	}

	public void setIsRoot(Boolean isRoot) {
		this.isRoot = isRoot;
	}

	public Boolean getIsPortable() {
		return isPortable;
	}

	public void setIsPortable(Boolean isPortable) {
		this.isPortable = isPortable;
	}

	public Boolean getNsetPublic() {
		return nsetPublic;
	}

	public void setNsetPublic(Boolean nsetPublic) {
		this.nsetPublic = nsetPublic;
	}

	public Boolean getNsetAutosync() {
		return nsetAutosync;
	}

	public void setNsetAutosync(Boolean nsetAutosync) {
		this.nsetAutosync = nsetAutosync;
	}

	public Integer getNsetSynctime() {
		return nsetSynctime;
	}

	public void setNsetSynctime(Integer nsetSynctime) {
		this.nsetSynctime = nsetSynctime;
	}

	public Boolean getNsetLocal2host() {
		return nsetLocal2host;
	}

	public void setNsetLocal2host(Boolean nsetLocal2host) {
		this.nsetLocal2host = nsetLocal2host;
	}

	public Boolean getNsetHost2local() {
		return nsetHost2local;
	}

	public void setNsetHost2local(Boolean nsetHost2local) {
		this.nsetHost2local = nsetHost2local;
	}

	public String getServerName() {
		return serverName;
	}

	public void setServerName(String serverName) {
		this.serverName = serverName;
	}

	public Integer getServerPort() {
		return serverPort;
	}

	public void setServerPort(Integer serverPort) {
		this.serverPort = serverPort;
	}

	public String getServerNick() {
		return serverNick;
	}

	public void setServerNick(String serverNick) {
		this.serverNick = serverNick;
	}

	public String getServerPword() {
		return serverPword;
	}

	public void setServerPword(String serverPword) {
		this.serverPword = serverPword;
	}

	public Boolean getServerAutoConnect() {
		return serverAutoConnect;
	}

	public void setServerAutoConnect(Boolean serverAutoConnect) {
		this.serverAutoConnect = serverAutoConnect;
	}

	public String[][] getGroupList() {
		return groupList;
	}

	public void setGroupList(String[][] groupList) {
		this.groupList = groupList;
	}

	public String[][][] getUserGroupList() {
		return userGroupList;
	}

	public void setUserGroupList(String[][][] userGroupList) {
		this.userGroupList = userGroupList;
	}
	
	
	public OptionsSet(Boolean isTemplate){
		super();
		if(isTemplate) setTemplate();
	}

	private void setTemplate() {
		// Common Preferences
		String user = System.getProperty("user.name");
		localUser = new User(user, null);
		hostUser = new User(user, null);
		author = System.getProperty("user.name");
		isRoot = true;
		isPortable = true;
		
		// Note Preferences
		nsetPublic = false;
		nsetAutosync = false;
		nsetSynctime = 5;
		nsetLocal2host = true;
		nsetHost2local = true;
		
		// Server / Online Preferences
		serverName = "http://localhost/login.php";
		serverPort = 80;
		serverNick = System.getProperty("user.name");
		serverPword = "";
		serverAutoConnect = false;
	}
}
